import java.util.Scanner;


/**
 * This program tests the mail system. A single phone communicates with the
 * program through System.in/System.out.
 */
public class MailSystemTester {
	public static void main(String[] args) {
		int option;
		Scanner input = new Scanner(System.in);
		
		System.out.println("Que tipo de interfaz desea? (1=Consola, 2 = Ventana)");
		option = input.nextInt();
		
		MailSystem system = new MailSystem(MAILBOX_COUNT);
		Communicable console;
		
		if ( option == 1 )
			console = new ConsoleInterface();
		else
			console = new WindowInterface();
		
		Telephone p = new Telephone(console);
		Connection c = new Connection(system, p);

		console.run(c);
	}

	private static final int MAILBOX_COUNT = 20;
}
